package com.centling.smartSealForPhone.activity

import android.os.Bundle
import com.centling.smartSealForPhone.R
import com.centling.smartSealForPhone.constants.SPConstants
import com.centling.smartSealForPhone.utils.SPUtil
import kotlinx.android.synthetic.main.activity_image_quality.*

class ImageQualityActivity : TitleBarActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_image_quality)

        setTitleBarText("图片设置")

        if (SPUtil.getBoolean(SPConstants.HQ_UPLOAD, true))
            rg_image_quality.check(R.id.rb_image_quality_high)
        else
            rg_image_quality.check(R.id.rb_image_quality_low)

        rb_image_quality_high.setOnCheckedChangeListener { _, checked ->
            if(checked){
                SPUtil.setBoolean(SPConstants.HQ_UPLOAD, true)
            } else{
                SPUtil.setBoolean(SPConstants.HQ_UPLOAD, false)
            }
        }
    }
}
